/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cpproject1;

public final class Point {

    private int x;
    private int y;

    /**
     * 
     * @return
     */
    public int getX() {
        return this.x;
    }

    /**
     * 
     * @return
     */
    public int getY() {
        return this.y;
    }

    /**
     * 
     * @param x
     * @param y
     */
    public void set(int x, int y) {
        this.x = x;
        this.y = y;
    }

    /**
     * 
     */
    public Point() {
        this.x = -1;
        this.y = -1;
    }

    /**
     * 
     * @param x
     * @param y
     */
    public Point(int x, int y) {
        this.set(x, y);
    }

    /**
     * 
     * @param p
     * @return
     */
    public Boolean equals(Point p) {
        return (this.x == p.x && this.y == p.y);
    }

    /**
     * 
     * @param lhs
     * @param rhs
     * @return
     */
    public int Compare(Object lhs, Object rhs) {
        Point p1 = (Point) lhs;
        Point p2 = (Point) rhs;
        if (p1.x == p2.x && p1.y == p2.y) {
            return 0;
        } else {
            return 1;
        }
    }

    /**
     * 
     * @param rhs
     * @return
     */
    public int CompareTo(Object rhs) {
        return Compare(this, rhs);
    }
}
